#define _CRT_SECURE_NO_WARNINGS 1
#include <string>
using namespace std;
class Solution {
public:
    bool solve(string A, string B)
    {
        int n = A.size();
        A += A;
        for (int i = 0;i < n;i++)
        {
            string tmp = A.substr(i, n);
            if (tmp == B) return true;
        }
        return false;
    }
};